﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using BigStamp.Entity;
using BigStamp;

namespace BigStamp
{
    /// <summary>
    /// Interaction logic for UserWindow.xaml
    /// </summary>
    public partial class UserWindow : Window
    {
        public UserWindow()
        {
            InitializeComponent();
        }

        private void btnAddUser_Click(object sender, RoutedEventArgs e)
        {
            if (Vaildate()==true)
            {
                
               //Utitiy.BigStampDatabase.Users.Add( new User());
                    //);
                Utility.AddUser(txtSrc.Text, txtSrcAddr.Text, txtSrcTel.Text);
                this.Close();
            }
        }

        private bool Vaildate() 
        {
            if (txtSrc.Text.Length>0&&
                txtSrcAddr.Text.Length>0&&
                txtSrcTel.Text.Length>0)
            {
                return true;
            }
            return false;
        }
    }
}
